Skip to content

Conversation

jamierpond
Copy link
Collaborator

  • Comments
  • string io affordance working
  • works
  • update copy
  • copy on write tests pass

@jamierpond jamierpond requested a review from thecppzoo April 29, 2025 04:23
}

auto makeExclusive() {
*sharedPointer() = std::make_shared<V>(*value());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that this would be an issue for the vast majority of cases, but maybe const qualify the lvalue reference so it always selects the copy constructor.

Suggested change
*sharedPointer() = std::make_shared<V>(*value());
*sharedPointer() = std::make_shared<V>(static_cast<const V &>(*value()));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants